/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-12-01
 * Time: 17:48
 */
import java.util.*;

public class Demo2 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        while(scan.hasNext()) {

            String str1 = scan.next();
            String str2 = scan.next();
            int count = 0;

            while(str1.contains(str2)) {
                str1 = str1.replaceFirst(str2,"");
                count++;
            }
            System.out.println(count);
        }
    }
}
